package com.hshx.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hshx.dao.TrainDao;
import com.hshx.pojo.Train;
import com.hshx.service.TrainService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Transactional
@Service
public class TrainServiceImpl extends ServiceImpl<TrainDao, Train> implements TrainService{
    @Resource
    private TrainDao trainDao;

    @Override
    public int addTrain(Train train) {
        return trainDao.addTrain(train);
    }

    @Override
    public int updateTrain(Train train) {
        return trainDao.updateTrain(train);
    }

    @Override
    public int updateTrainState(Integer train_id, Integer train_state) {
        return trainDao.updateTrainState(train_id,train_state);
    }

//    @Override
//    public int deleteTrainIds(List<String> salary_id_list) {
//        return ;
//    }

    @Override
    public Train queryTrainID(Integer train_id) {
        return trainDao.queryTrainID(train_id);
    }
}
